|
|
|
|
|
by mg
709 days ago
|
|
I like the syntax to send typed values from the terminal: jb id=42 size:number=42 surname=null data:null
=> {"id":"42","size":42,"surname":"null","data":null}
I never had the need to use typed arguments in bash, but if I ever have it, this might be the syntax I'd use.In fact, I was thinking about such a syntax recently. I am writing a tool which lets you call functions in Python modules from the command line. At first, I thought I need to define the argument types on the command line. But then I decided it is more convenient to use inspection and auto-convert the values to the needed types. |
|
The same using jo would be like this, which I find harder to type and remember:
Notice that surname comes out as the empty string though, I think this must be a bug in jo!