You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dotnet-json/Commands/CommandBase.cs
+15-13Lines changed: 15 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -14,31 +14,33 @@ public abstract class CommandBase : Command, ICommandHandler
14
14
{
15
15
protectedFileArgumentInputFile=newFileArgument("file","The JSON file (use '-' for STDIN)");
16
16
17
-
protectedFileOptionOutputFile=newFileOption(new[]{"-o","--output"},"The output file (use '-' for STDOUT, defaults to <file>)"){Argument={Name="file",Arity=ArgumentArity.ZeroOrOne}};
17
+
protectedFileOptionOutputFile=newFileOption(new[]{"-o","--output"},"The output file (use '-' for STDOUT, defaults to <file>)"){AllowNewFile=true};
18
18
19
19
protectedOption<bool>Compressed=newOption<bool>(new[]{"-c","--compressed"},"Write the output in compressed form (defaults to indented)");
privateArgument<string>Key=newArgument<string>("key","The key to get (use ':' to get a nested object and use index numbers to get array values eg. nested:key or nested:1:key)"){Arity=ArgumentArity.ExactlyOne};
12
+
13
+
privateOption<bool>Exact=newOption<bool>(new[]{"-e","--exact"},"only return exact value matches, this will return an error for references to nested objects/arrays.");
14
+
15
+
publicGetCommand()
16
+
:base("get","Read a value from a JSON file.",false)
0 commit comments