public void WithOptions(OptionParser opts) { opts.Header = "Executes a COMMAND once for each line of input on STDIN."; opts.Required.Arg <string>("COMMAND", "{0} to execute.").Do(command => settings.Command = command); opts.Args <string>("ARGUMENTS", "Additional {0} to COMMAND. Use - to grab a line from STDIN.").Do(settings.Arguments.AddRange); opts.On("verbose", 'v', "Echo each execution of COMMAND on STDERR.").Do(() => settings.Verbose = true); }
public void WithOptions(OptionParser opts) { opts.Header = "Executes a COMMAND once for each line of input on STDIN."; opts.Required.Arg<string>("COMMAND", "{0} to execute.").Do(command => settings.Command = command); opts.Args<string>("ARGUMENTS", "Additional {0} to COMMAND. Use - to grab a line from STDIN.").Do(settings.Arguments.AddRange); opts.On("verbose", 'v', "Echo each execution of COMMAND on STDERR.").Do(() => settings.Verbose = true); }
public void WithOptions(OptionParser opts) { opts.Header = "Search for PATTERN in each FILE or standard input.\n"; opts.Header += "Example: grep -i \"hello world\" menu.h main.c"; opts.Required.Arg <string>("PATTERN", "{0} is a .NET/Mono Regular Expression string.").Do(pattern => settings.Pattern = pattern); opts.Args <string>("FILE", "").Do(settings.Files.AddRange); opts.In("Regexp selection and interpretation", g => { g.On("ignore-case", 'i', "ignore case distinctions").Do(() => settings.RegexOptions |= RegexOptions.IgnoreCase); }); opts.In("Miscellaneous", g => { g.On("no-messages", 's', "suppress error messages").Do(() => settings.SuppressErrorMessages = true); g.On("invert-match", 'v', "select non-matching lines").Do(() => settings.InvertMatch = true); }); opts.In("Output control", g => { g.On("line-number", 'n', "print line number with output lines").Do(() => settings.Output.LineNumbers = true); g.On("with-filename", 'H', "print the filename for each match").Do(() => settings.Output.FileNames = true); g.On("no-filename", 'h', "print line number with output lines").Do(() => settings.Output.FileNames = false); g.On("files-without-match", 'L', "only print FILE names containing no match").Do(() => settings.Output.OnlyFileNames = OnlyFileNames.NonMatching); g.On("files-with-matches", 'l', "only print FILE names containing matches").Do(() => settings.Output.OnlyFileNames = OnlyFileNames.Matching); }); opts.Footer = "With no FILE, or when FILE is -, read standard input. If less than\n"; opts.Footer += "two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n"; opts.Footer += "and 2 if trouble."; }
public void WithOptions(OptionParser opts) { opts.Header = "Copy standard input to each FILE, and also to standard output."; opts.Args <string>("FILE", "").Do(settings.Files.AddRange); opts.On("append", 'a', "Append to the given FILEs, do not overwrite").Do(() => settings.FileMode = FileMode.Append); opts.Footer = "With no FILE, or when a FILE is -, copy again to standard output."; }
public void WithOptions(OptionParser opts) { opts.Header = "Copy standard input to each FILE, and also to standard output."; opts.Args<string>("FILE", "").Do(settings.Files.AddRange); opts.On("append", 'a', "Append to the given FILEs, do not overwrite").Do(() => settings.FileMode = FileMode.Append); opts.Footer = "With no FILE, or when a FILE is -, copy again to standard output."; }
public void WithOptions(OptionParser opts) { opts.Header = "Summarize disk usage of each FILE, recursively for directories."; opts.Args<string>("FILE", "").Do(files => { }); opts.Footer = "Display values are in units of the first available SIZE from --block-size,\n"; opts.Footer += "and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.\n"; opts.Footer += "Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\n"; opts.Footer += "\n"; opts.Footer += "SIZE may be (or may be an integer optionally followed by) one of following:\n"; opts.Footer += "KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n"; }
public void WithOptions(OptionParser opts) { opts.Header = "Summarize disk usage of each FILE, recursively for directories."; opts.Args <string>("FILE", "").Do(files => { }); opts.Footer = "Display values are in units of the first available SIZE from --block-size,\n"; opts.Footer += "and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.\n"; opts.Footer += "Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\n"; opts.Footer += "\n"; opts.Footer += "SIZE may be (or may be an integer optionally followed by) one of following:\n"; opts.Footer += "KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n"; }
public void WithOptions(OptionParser opts) { opts.Header = "Show information about the file system on which each FILE resides,\nor all file systems by deafult."; opts.Args <string>("FILE", "").Do(files => { }); opts.On("block-size", 'B', "use SIZE-byte blocks").WithArg <int>("SIZE").Do(arg => { customBlockSize = true; blockSize = arg; }); opts.On("human-readable", 'h', "print sizes in human readable format (e.g., 1K 234M 2G)").Do(() => humanReadable = true); opts.On("si", 'H', "likewise, but use powers of 1000 not 1024").Do(() => humanReadableWithSi = true); opts.On("portability", 'P', "use the POSIX output format").Do(() => posixFormat = true); opts.On("type", 't', "limit listing to file systems of type TYPE").WithArg <string>("TYPE").Do(arg => limitToType = arg); opts.On("print-type", 'T', "print file system type").Do(() => printFileSystemType = true); opts.On("exclude-type", 'x', "limit listing to file systems not of type TYPE").WithArg <string>("TYPE").Do(arg => excludeType = arg); opts.Footer = "Display values are in units of the first available SIZE from --block-size,\n"; opts.Footer += "and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.\n"; opts.Footer += "Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\n"; opts.Footer += "\n"; opts.Footer += "SIZE may be (or may be an integer optionally followed by) one of following:\n"; opts.Footer += "KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n"; }
public void WithOptions(OptionParser opts) { opts.Header = "Show information about the file system on which each FILE resides,\nor all file systems by deafult."; opts.Args<string>("FILE", "").Do(files => { }); opts.On("block-size", 'B', "use SIZE-byte blocks").WithArg<int>("SIZE").Do(arg => { customBlockSize = true; blockSize = arg; }); opts.On("human-readable", 'h', "print sizes in human readable format (e.g., 1K 234M 2G)").Do(() => humanReadable = true); opts.On("si", 'H', "likewise, but use powers of 1000 not 1024").Do(() => humanReadableWithSi = true); opts.On("portability", 'P', "use the POSIX output format").Do(() => posixFormat = true); opts.On("type", 't', "limit listing to file systems of type TYPE").WithArg<string>("TYPE").Do(arg => limitToType = arg); opts.On("print-type", 'T', "print file system type").Do(() => printFileSystemType = true); opts.On("exclude-type", 'x', "limit listing to file systems not of type TYPE").WithArg<string>("TYPE").Do(arg => excludeType = arg); opts.Footer = "Display values are in units of the first available SIZE from --block-size,\n"; opts.Footer += "and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.\n"; opts.Footer += "Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\n"; opts.Footer += "\n"; opts.Footer += "SIZE may be (or may be an integer optionally followed by) one of following:\n"; opts.Footer += "KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n"; }
public void WithOptions(OptionParser opts) { opts.Header = "Search for PATTERN and replace with REPLACE in each FILE or standard input.\n"; opts.Header += "Example: sed 'hello world' 'goodbye world' menu.h main.c"; opts.Required.Arg<string>("PATTERN", "{0} is a .NET/Mono Regular Expression string.").Do(pattern => settings.Pattern = pattern); opts.Required.Arg<string>("REPLACE", "").Do(replace => settings.Replace = replace); opts.Args<string>("FILE", "").Do(settings.Files.AddRange); opts.In("Regexp selection and interpretation", g => { g.On("ignore-case", 'i', "ignore case distinctions").Do(() => settings.RegexOptions |= RegexOptions.IgnoreCase); }); opts.In("Miscellaneous", g => { g.On("no-messages", 's', "suppress error messages").Do(() => settings.SuppressErrorMessages = true); }); opts.Footer = "With no FILE, or when FILE is -, read standard input.\n"; opts.Footer += "Exit status is 0 on success and 2 if trouble."; }
public void WithOptions(OptionParser opts) { opts.Header = "Search for PATTERN and replace with REPLACE in each FILE or standard input.\n"; opts.Header += "Example: sed 'hello world' 'goodbye world' menu.h main.c"; opts.Required.Arg <string>("PATTERN", "{0} is a .NET/Mono Regular Expression string.").Do(pattern => settings.Pattern = pattern); opts.Required.Arg <string>("REPLACE", "").Do(replace => settings.Replace = replace); opts.Args <string>("FILE", "").Do(settings.Files.AddRange); opts.In("Regexp selection and interpretation", g => { g.On("ignore-case", 'i', "ignore case distinctions").Do(() => settings.RegexOptions |= RegexOptions.IgnoreCase); }); opts.In("Miscellaneous", g => { g.On("no-messages", 's', "suppress error messages").Do(() => settings.SuppressErrorMessages = true); }); opts.Footer = "With no FILE, or when FILE is -, read standard input.\n"; opts.Footer += "Exit status is 0 on success and 2 if trouble."; }
public void WithOptions(OptionParser opts) { opts.Header = "Search for PATTERN in each FILE or standard input.\n"; opts.Header += "Example: grep -i \"hello world\" menu.h main.c"; opts.Required.Arg<string>("PATTERN", "{0} is a .NET/Mono Regular Expression string.").Do(pattern => settings.Pattern = pattern); opts.Args<string>("FILE", "").Do(settings.Files.AddRange); opts.In("Regexp selection and interpretation", g => { g.On("ignore-case", 'i', "ignore case distinctions").Do(() => settings.RegexOptions |= RegexOptions.IgnoreCase); }); opts.In("Miscellaneous", g => { g.On("no-messages", 's', "suppress error messages").Do(() => settings.SuppressErrorMessages = true); g.On("invert-match", 'v', "select non-matching lines").Do(() => settings.InvertMatch = true); }); opts.In("Output control", g => { g.On("line-number", 'n', "print line number with output lines").Do(() => settings.Output.LineNumbers = true); g.On("with-filename", 'H', "print the filename for each match").Do(() => settings.Output.FileNames = true); g.On("no-filename", 'h', "print line number with output lines").Do(() => settings.Output.FileNames = false); g.On("files-without-match", 'L', "only print FILE names containing no match").Do(() => settings.Output.OnlyFileNames = OnlyFileNames.NonMatching); g.On("files-with-matches", 'l', "only print FILE names containing matches").Do(() => settings.Output.OnlyFileNames = OnlyFileNames.Matching); }); opts.Footer = "With no FILE, or when FILE is -, read standard input. If less than\n"; opts.Footer += "two FILEs given, assume -h. Exit status is 0 if match, 1 if no match,\n"; opts.Footer += "and 2 if trouble."; }