diff --git a/hel/src/parser.rs b/hel/src/parser.rs index 085b1ed..e311137 100644 --- a/hel/src/parser.rs +++ b/hel/src/parser.rs @@ -37,13 +37,19 @@ peg::parser! { { Password::new(None, pn, pl, pm, ps, pd, pc) } rule mname() -> Password = &(word() _ word() _ num()? mode() _ date()) pr:word() _ pn:word() _ pl:num()? pm:mode() _ pd:date() pc:comment()? { Password::new(Some(pr), pn, pl, pm, 99, pd, pc) } + // prefix + name + [len]mode (no seq/date) -> defaults seq 99, date now + rule npname() -> Password = &(word() _ word() _ num()? mode()) pr:word() _ pn:word() _ pl:num()? pm:mode() + { Password::new(Some(pr), pn, pl, pm, 99, Date::now(), None) } rule sname() -> Password = &(word() _ num()? mode() _ date()) pn:word() _ pl:num()? pm:mode() _ pd:date() pc:comment()? { Password::new(None, pn, pl, pm, 99, pd, pc) } rule nname() -> Password = &(word() _ num()? mode()) pn:word() _ pl:num()? pm:mode() { Password::new(None, pn, pl, pm, 99, Date::now(), None) } + // prefix + name only -> defaults mode R, seq 99, date now + rule qpname() -> Password = &(word() _ word()) pr:word() _ pn:word() + { Password::new(Some(pr), pn, None, Mode::Regular, 99, Date::now(), None) } rule qname() -> Password = &(word()) pn:word() { Password::new(None, pn, None, Mode::NoSpaceCamel, 99, Date::now(), None) } - pub rule name() -> Password = name:(jname() / pname() / mname() / sname() / nname() / qname())? {? + pub rule name() -> Password = name:(jname() / pname() / mname() / npname() / sname() / nname() / qpname() / qname())? {? match name { Some(n) => Ok(n), None => Err("failed to parse password description") } } diff --git a/hel/src/repl.rs b/hel/src/repl.rs index ea5af3b..06047c9 100644 --- a/hel/src/repl.rs +++ b/hel/src/repl.rs @@ -141,7 +141,29 @@ impl<'a> LKEval<'a> { Command::Uncorrect(name) => self.cmd_correct(&out, name, false, None), Command::Noop => { to_history = false; }, Command::Help => { - out.o("HELP".to_string()); + out.o(concat!( + "hel - passwords are generated from your master + the entry name; nothing secret is stored.\n", + "\n", + "entries\n", + " add [len][mode] [seq] [date] [text] [^parent] define an entry\n", + " ls [regex] list by name ld [regex] list by date\n", + " mv rename / move rm remove\n", + " comment [text] set or clear the comment\n", + "\n", + "passwords\n", + " enc show the generated password\n", + " gen[N] N numbered variants; name ends in G.. (all) or X.. (random)\n", + " pass [pw] cache a master / override for an entry's subtree\n", + " unpass forget a cached password (unpass / = the root master)\n", + " correct trust this password's hash uncorrect untrust it\n", + "\n", + "catalog\n", + " dump print the catalog ls list it\n", + " save [target] write it (file / localStorage key / |command)\n", + " source load it set config\n", + "\n", + "modes R regular C camel N nospace H hex B base64 D decimal (U.. = UPPER)" + ).to_string()); } Command::Mv(name, folder) => self.cmd_mv(&out, &name, &folder), Command::Error(error) => { diff --git a/helwasm/assets/apple-touch-icon.png b/helwasm/assets/apple-touch-icon.png new file mode 100644 index 0000000..9f3bcd6 Binary files /dev/null and b/helwasm/assets/apple-touch-icon.png differ diff --git a/helwasm/assets/enso.png b/helwasm/assets/enso.png new file mode 100644 index 0000000..9912e4a Binary files /dev/null and b/helwasm/assets/enso.png differ diff --git a/helwasm/assets/favicon-16x16.png b/helwasm/assets/favicon-16x16.png new file mode 100644 index 0000000..764fbe6 Binary files /dev/null and b/helwasm/assets/favicon-16x16.png differ diff --git a/helwasm/assets/favicon-32x32.png b/helwasm/assets/favicon-32x32.png new file mode 100644 index 0000000..fc2cbdc Binary files /dev/null and b/helwasm/assets/favicon-32x32.png differ diff --git a/helwasm/assets/favicon.ico b/helwasm/assets/favicon.ico new file mode 100644 index 0000000..8a083fc Binary files /dev/null and b/helwasm/assets/favicon.ico differ diff --git a/helwasm/assets/icon-192.png b/helwasm/assets/icon-192.png new file mode 100644 index 0000000..93698ec Binary files /dev/null and b/helwasm/assets/icon-192.png differ diff --git a/helwasm/assets/icon-512.png b/helwasm/assets/icon-512.png new file mode 100644 index 0000000..c8e6106 Binary files /dev/null and b/helwasm/assets/icon-512.png differ diff --git a/helwasm/assets/site.webmanifest b/helwasm/assets/site.webmanifest new file mode 100644 index 0000000..353add8 --- /dev/null +++ b/helwasm/assets/site.webmanifest @@ -0,0 +1,11 @@ +{ + "name": "LesS/KEY — password generator", + "short_name": "LesS/KEY", + "icons": [ + { "src": "./icon-192.png", "sizes": "192x192", "type": "image/png" }, + { "src": "./icon-512.png", "sizes": "512x512", "type": "image/png" } + ], + "theme_color": "#0a2540", + "background_color": "#f4f0e8", + "display": "standalone" +} diff --git a/helwasm/index.html b/helwasm/index.html index 0eae979..50a00ae 100644 --- a/helwasm/index.html +++ b/helwasm/index.html @@ -3,8 +3,13 @@ - + LesS/KEY — password generator + + + + + + + +