elliot40404 / bonk

The blazingly fast touch alternative with a sprinkle of mkdir written in rust.
MIT License
97 stars 9 forks source link

Help parameters create files #12

Closed Efreak closed 12 months ago

Efreak commented 1 year ago

Amy parameters, including help parameters, will be created as files.

❯ ls ./-* -lh
ls: cannot access './-*': No such file or directory

~ took 16ms
❯ bonk --help >/dev/null

~ took 32ms
❯ bonk -h >/dev/null

~ took 32ms
❯ bonk --something >/dev/null

~ took 49ms
❯ ls ./-* -lh
-rw------- 1 u0_a1429 u0_a1429 0 Feb  2 00:18 ./--help
-rw------- 1 u0_a1429 u0_a1429 0 Feb  2 00:18 ./--something
-rw------- 1 u0_a1429 u0_a1429 0 Feb  2 00:18 ./-h

~ took 21ms
❯
elliot40404 commented 1 year ago

Inherently bonk takes in no parameters and everything after the binary is either a dir or a file to be created. Would it be useful to have a help menu along with some other options? If so what should some of the options be. Just looking for suggestions

Efreak commented 1 year ago

My point was more that --help is a fairly common parameter for help, and that is even identified as such here, yet it gets processed as both a request for help and as input:

❯ bonk --help

Description:
  A blazingly fast alternative to the classic 'touch' command.
  Can create a single file or multiple files even in nested directories.
Options:
-h, --help: Show this help message
Example:
  bonk bonkers.txt
  bonk bonkers.txt bonkers2.txt
  bonk bonky/chonky/boi.txt
  bonk bonky/chonky/ bonkers.txt

~ took 15ms
❯ ls -lh ./-*
-rw------- 1 u0_a1429 u0_a1429 0 Feb  2 09:36 ./--help

~ took 19ms
❯