Code-first command? #484
Replies: 2 comments 1 reply
-
When inside dotnet runtime, wouldn't it be easier to just call the methods directly? |
Beta Was this translation helpful? Give feedback.
-
Are you looking to serialize the object to With CommandDotNet, arguments are not defined directly on a command class, but rather are always pinned to a method, so it wouldn't know how to interpret what you've defined above. If you're looking to pass the serialized object json to the target application, the target application would need a separate command to parse the json since it's a different format than the command being passed in. Or you'd create a directive and token transformer that could convert the json into arguments before the command processor parses them. Either way, there's nothing built in for this. |
Beta Was this translation helpful? Give feedback.
-
Spending some time reading the documentation and experimenting with the tool.
Wonder if there's a way that, creating an object from code would return it into a command line string before passing it to a process runner. Or am i missing the idea?
Lets say:
[Command(Name:"a")]
public class A {
[Option("x")
public int X {get; set;}
[Option("y")
public int Y {get; set;}
}
and then the creation of an object var A = new A { x = 1, y = 2 }, would pass the command to the runner as # a -x 1 -y 2.
Beta Was this translation helpful? Give feedback.
All reactions