huyng/bashmarks

Feature: Improved CLI structure (single command w/ options)

broofa opened this issue · 2 comments

The current CLI of s, g, d, l, and p takes up single-letter designations that many developers prefer to use for custom aliases. It is also unconventional, in that most *nix CLIs are a single command with option flags for the different actions.

This also causes forward-compatibility issues. For example, if #77 is implemented the current convention would argue for a c(leanup) command, but this may unexpectedly collide if someone already has a c alias or function.

Furthermore, the only action that really merits a single-letter designation is the g command [edit: sorry, I meant 'g', not 'c']. That's the only one that is used enough to warrant the single-letter shortcut. (Navigating to a directory occurs 100x more often than setting, listing, or deleting.)

Thus, I suggest switching the CLI to a single command (e.g. 'mark'), thusly:

Old New Comment
g mark (no options) aliased as g
s mark --set or mark -s
d mark --delete or mark -d
l mark --list or mark -l
p mark --print or mark -p
(new) mark --help or mark -h usage and help info
(new) mark --legacy Creates s, d, l, p aliases (which would not be configured by default)
(new) mark --clean or mark -c Cleanup. see #77

I agree, but the functions can easily be renamed in the script, But again , I agreeiIt is better to set an alias, I have a conflict with alias s='pacman -S'

I cobbled together something that tries to implement the suggestion above. No idea if it will work for everyone but it worked well enough in my own testing. https://github.com/chunkily/bashmarks