yugaego 🌻 · @yugaego
23 followers · 130 posts · Server fosstodon.org

:

"
This command makes it easy for fish scripts and functions to handle arguments.
"

Example from docs:
```
function mybetterfunction
argparse h/help s/second -- $argv
or return

if set -ql _flag_help
echo "mybetterfunction [-h|--help] [-s|--second] [ARGUMENT ...]"
return 0
end

if set -ql _flag_second
echo $argv[2]
else
echo $argv[1]
echo $argv[3]
end
end
```

fishshell.com/docs/current/cmd

#TIL #fishshell #argparse

Last updated 1 year ago

who · @purelinux
149 followers · 31 posts · Server social.tchncs.de

Also mir erschließt sich nach wie vor nicht, warum man für einfache Tools in nutzen sollte. Beziehungsweise warum manche Menschen es tun. Überhaupt nicht.

Da kann man auch nahezu 1:1 nehmen. Die Syntax ist in meinen Augen deutlich schlüssiger und man spart sich eine Library, weil Argparse ist ja Bordmittel.

Mag mich jemand erleuchten?

#click #cli #python3 #argparse

Last updated 1 year ago

Volkan Özçelik · @volkan
35 followers · 1223 posts · Server z2h.dev

Argparse for golang. Just because `flag` sucks »
github.com/akamensky/argparse

#argparse #go #libraries #devex

Last updated 2 years ago

My first attempt at using 's for a small tool (generate a animation). I thought about learning but reading the documentation it didn't "click" for me...

#python #argparse #cli #gif #click

Last updated 2 years ago

Gregor Rot · @grexor
15 followers · 9 posts · Server genomic.social

"Give it one space"

argparse -parameter "-log(p-value)"

Breaks since the minus at log is considered as another parameter. Solution? Give it some space:

argparse -parameter " -log(p-value)"

Ah, tricks, tricks.

#python #argparse #programming

Last updated 2 years ago