jvirkki / dupd

CLI utility to find duplicate files
http://www.virkki.com/dupd
GNU General Public License v3.0
113 stars 16 forks source link

Feature request: allow options before the command #44

Open esoel opened 2 years ago

esoel commented 2 years ago

Please allow options before the command so that common parameters (eg --db PATH) can be embedded in an alias.

jvirkki commented 2 years ago

Interesting use case. The command parsing code is all machine-generated code so to change it I need to change the code generator. I can look into that some day but not anytime soon.

Meanwhile, you could achieve the desired behavior with a shell script or shell function. For example, in zsh this function will define an alias "dupdalias" which will behave as described:

dupdalias() {
    DUPDCOMMAND=$1
    argv[1]=()
    dupd $DUPDCOMMAND --db /tmp/dupd.database $argv
}
esoel commented 2 years ago

Thanks