denisidoro / navi

An interactive cheatsheet tool for the command-line
Apache License 2.0
15.21k stars 507 forks source link

Add optional arguments #887

Open Signum21 opened 8 months ago

Signum21 commented 8 months ago

It would be useful to have optional arguments for commands, possibly with selectable values.

An example that works for the ls command.

# List files
ls <parameters>

$ parameters: echo -e "-l\n-a\n"
screen

The last \n creates a blank line that can be selected to avoid choosing an option.

This method doesn't work for optional parameters that require a value, for example head -n 5

welcome[bot] commented 8 months ago

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

tapyu commented 4 months ago

Totally agreed. This is a missing feature. What would be the syntax?

I've found a workaround solution for your case in https://github.com/denisidoro/navi/issues/899#issuecomment-2214205720