ngs
ngs copied to clipboard
jc integration - suggest to install
NGS should recommend to install jc
when NGS is unable parse the output of a command or a contents of a file.
Parsing a command
data = ``some_command``
If the above fails, the recommendation should say something like "please install jc
and run as following:"
data = ``jc some_command``
Parsing a file
Example:
data = fetch('/etc/fstab')
Same for the above except no code modification is required, just re-run when jc
is installed.
Useful information
Baking the list of supported commands into NGS
-
jc -a
outputs a list of supported commands and platforms - The platform roughly corresponds to
sys.platform
in Python - Beware of
two_word_command
- a command with an argument, for exampleairport -s
-
jc -a
apparently does not have paths of supported files (like/etc/fstab
) except for indescription
Have second thoughts regarding the exact behavior of fetch()
. It is asymmetrical with the run-and-parse syntax. The issue here is if at any point in time, NGS will consider a particular file or two so important as to have built-in parser in NGS, there would be a conflict.
TODO: also handle the situation with run-and-parse when jc
is installed but was not used