Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm testing out an application and its sourcecode gives no clues as to the actual syntax other than the help output.

I have tried many combinations trying to get it to work, and it keeps outputting me the help screen due to invalid syntax. Here is the usage:

Usage is : ngenerator <options> filepath|directorypath
Where <options> may be :

        -h : print this help notice
        -d : Tell NGenerator that the supplied path is a directory path -o filename : write the source code in filename
        -u Unsafe|Safe[UnsafeWithWrapper : the degree of "unsafeness" of the source, see man

Now if you were looking at this, what would the correct way for it to work be? The program has absolutely no documentation, and it is from a dead project. Upon first look can you give me what you would think would be the proper way to enter the syntax?

share|improve this question
    
The actual usage seems straightforward - use ngenerator -d <directory> to run the program on a directory, and ngenerator -o <filepath> to run it on a file. No idea what's meant by "unsafeness", though - can you provide any more information (the man page or source code)? –  user55325 Nov 9 '13 at 6:05
    
I have tried running it like ngenerator -d C:\test , also ngenerator -d "C:\test" , also ngenerator -o C:\test\app.h and with quotes around the path on that as well...everytime I keep getting a system.argumentnullexception. Here is the page, you can download the code on the page if you want. This is all there is to go by. URL –  user1632018 Nov 9 '13 at 6:24
    
I can't run it now, but from a cursory look at the code, I think it wants something like ngenerator -d:<directory> - obviously that wouldn't work with an absolute path (it doesn't appear to escape the string), but try running ngenerator -d:test from C:. –  user55325 Nov 9 '13 at 7:45

1 Answer 1

To answer this question title.. The output from command-line help should be standard. Generally Linux tends to be more consistent than windows, but this is generally how they can be understood:

C:\>attrib /?
Displays or changes file attributes.

ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [+I | -I]
       [drive:][path][filename] [/S [/D] [/L]]
...

The rules are usually as follows:

  • Anything in [] is optional
  • Optional parameters may be nested: [/S [/D] [/L]] means you may optionally provide /S and if you do, you can also optionally provide /D and/or /L
  • Some parameters are an 'either/or' situation: [+R | -R] means you may optionally specify either +R or -R but not both.

Here's another example:

Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
            [-r count] [-s count] [[-j host-list] | [-k host-list]]
            [-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name

Note that Windows sometimes uses - and sometimes uses / to prefix parameters (sigh). This shows you that some optional parameters, such as -n also need a value, count and also that target_name is mandatory because it is not in []

The output of ngenerator:

Usage is : ngenerator <options> filepath|directorypath
Where <options> may be :

        -h : print this help notice
        -d : Tell NGenerator that the supplied path is a directory path -o filename : write the source code in filename
        -u Unsafe|Safe[UnsafeWithWrapper : the degree of "unsafeness" of the source, see man

...Is very poor. Looking at this I would try: ngenerator -o c:\file.h. Does it want c:\file.h to already exist? Looking at the repository there is a horrific amount of code to parse such a simple command line, which doesn't give much confidence in the app. Does it need C:\\file.h ?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.