urbanjost / m_cli Goto Github PK
View Code? Open in Web Editor NEWUnix-like command line parsing -- prototype style converts command line to a NAMELIST group
License: The Unlicense
Unix-like command line parsing -- prototype style converts command line to a NAMELIST group
License: The Unlicense
Hi @urbanjost,
I'm doing some work (fortran-lang/fpm-registry#11) on the fpm-registry in order to get fpm packages listed on the website.
As part of this I've been parsing fpm.toml
files from each package in the registry and I've noticed that M_CLI uses an invalid TOML syntax. Though Haskell fpm doesn't complain about this, it is causing some issues when parsing the TOML in Python.
According to the spec, there must be a newline after each key/value pair.
I believe the minimal syntax you are looking for can be achieved with inline tables, see here (scroll up slightly).
If I get time later, I can put together a pull request.
suppose:
CHARACTER(len=20) , DIMENSION(10) :: afuncs=""
and we have:
cmd = commandline('--afuncs "myfunc1","myfunc2","myfunc3"')
which perfectly assigns default values to afuncs(1),afuncs(2) and afuncs(3). The rest remain empty.
However, the same syntax does not work when calling from command line:
./myprogram --afuncs "thisfunc","thatfunc","thisfunc2"
This puts all of "thisfunc,thatfunc,thisfunc2" in afuncs(1). The rest remain as the default values. I have tested other combinations and cannot come up with a syntax to correctly assign each string to one cell on the command line.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.