Skip to content

Commit

Permalink
Fix mischaracterization and usage of Optional parameters in command l…
Browse files Browse the repository at this point in the history
…ine (#395)

* fixed bug

* Update command-reference.md
  • Loading branch information
chenzhitong authored Nov 27, 2023
1 parent ecb45e9 commit 3337229
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions docs/command-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ Usage: neoxp create [Options] [Output]
Arguments:
[Options]:
-o|--output <OUTPUT> Name of .neo-express file to create
Default location is home directory as:
Linux: $HOME/.neo-express/default.neo-express
Windows: %UserProfile%\.neo-express\default.neo-express
-c|--count <COUNT> Number of consensus nodes to create
Default: 1
Allowed values are: 1, 4, 7.
-a|--address-version <ADDRESS_VERSION> Version to use for addresses in this blockchain instance
Default: 53
-f|--force Overwrite existing data
[Output]: name of .neo-express file to create (Default: ./default.neo-express)
```

The `create` command is used to create a new Neo-Express blockchain network for local development
Expand All @@ -84,15 +87,14 @@ via the `--input` option.
## neoxp run

```
Usage: neoxp run [Options] [NodeIndex]
Usage: neoxp run [Options]
Arguments:
[Options]:
-n|--node-index <NODE_INDEX> Index of node to run (Default: 0)
-i|--input <INPUT> Path to neo-express data file
-s|--seconds-per-block <SECONDS_PER_BLOCK> Time between blocks
-d|--discard Discard blockchain changes on shutdown
-t|--trace Enable contract execution tracing
[NodeIndex]: Index of node to run (Default: 0)
```

Once created, a Neo-Express blockchain network is started with the `run` command. The consensus
Expand All @@ -118,13 +120,12 @@ the blockchain network is shut down.
## neoxp stop

```
Usage: neoxp stop [Options] [NodeIndex]
Usage: neoxp stop [Options]
Arguments:
[Options]:
-i|--input <INPUT> Path to neo-express data file
-n|--node-index <NODE_INDEX> Index of node to stop (Default: 0)
-i|--input <INPUT> Path to neo-express data file
-a|--all Stop all nodes
[NodeIndex]: Index of node to stop (Default: 0)
```

When running in a terminal window, neo-express can be shutdown via standard CTRL-C or CTRL-BREAK operations.
Expand All @@ -135,14 +136,13 @@ nodes in the network.
## neoxp reset

```
Usage: neoxp reset [Options] [NodeIndex]
Usage: neoxp reset [Options]
Arguments:
[Options]:
-i|--input <INPUT> Path to neo-express data file
-f|--force Overwrite existing data
-a|--all Reset all nodes
[NodeIndex]: Index of node to reset (Default: 0)
-n|--node-index <NODE_INDEX> Index of node to reset (Default: 0)
-i|--input <INPUT> Path to neo-express data file
-f|--force Overwrite existing data
-a|--all Reset all nodes
```

A Neo-express blockchain network can be reset back to its genesis block via the `reset` command. This
Expand Down
2 changes: 1 addition & 1 deletion src/neoxp/Commands/CreateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public CreateCommand(ExpressChainManagerFactory chainManagerFactory, IFileSystem
this.txExecutorFactory = txExecutorFactory;
}

[Argument(0, Description = $"Name of {EXPRESS_EXTENSION} file to create\nDefault location is home directory as:\nLinux: $HOME/.neo-express/{DEFAULT_EXPRESS_FILENAME}\nWindows: %UserProfile%\\.neo-express\\{DEFAULT_EXPRESS_FILENAME}")]
[Option(Description = $"Name of {EXPRESS_EXTENSION} file to create\nDefault location is home directory as:\nLinux: $HOME/.neo-express/{DEFAULT_EXPRESS_FILENAME}\nWindows: %UserProfile%\\.neo-express\\{DEFAULT_EXPRESS_FILENAME}")]
internal string Output { get; set; } = string.Empty;

[Option(Description = "Number of consensus nodes to create (Default: 1)")]
Expand Down
2 changes: 1 addition & 1 deletion src/neoxp/Commands/ResetCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ResetCommand(ExpressChainManagerFactory chainManagerFactory)
this.chainManagerFactory = chainManagerFactory;
}

[Argument(0, Description = "Index of node to reset")]
[Option(Description = "Index of node to reset")]
internal int? NodeIndex { get; }

[Option(Description = "Path to neo-express data file")]
Expand Down
2 changes: 1 addition & 1 deletion src/neoxp/Commands/RunCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public RunCommand(ExpressChainManagerFactory chainManagerFactory)
this.chainManagerFactory = chainManagerFactory;
}

[Argument(0, Description = "Index of node to run")]
[Option(Description = "Index of node to run")]
internal int NodeIndex { get; init; } = 0;

[Option(Description = "Path to neo-express data file")]
Expand Down
2 changes: 1 addition & 1 deletion src/neoxp/Commands/StopCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public StopCommand(ExpressChainManagerFactory chainManagerFactory)
this.chainManagerFactory = chainManagerFactory;
}

[Argument(0, Description = "Index of node to stop")]
[Option(Description = "Index of node to stop")]
internal int? NodeIndex { get; }

[Option(Description = "Path to neo-express data file")]
Expand Down

0 comments on commit 3337229

Please sign in to comment.