-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Automatically exec legacy JS CLI commands for full backward com…
…patibility (#366) This PR tries to automatically execute the CLI commands that are suggested after somebody tries to run a JS commands.
- Loading branch information
Showing
6 changed files
with
78 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use color_eyre::owo_colors::OwoColorize; | ||
|
||
#[derive(Debug, Clone, clap::Parser)] | ||
/// This is a legacy `validators` command. Once you run it with the specified arguments, new syntax command will be suggested. | ||
pub struct ValidatorsArgs { | ||
#[clap(allow_hyphen_values = true, num_args = 0..)] | ||
_unknown_args: Vec<String>, | ||
} | ||
|
||
#[derive(Debug, Clone, clap::Parser)] | ||
pub struct StakeArgs { | ||
#[clap(allow_hyphen_values = true, num_args = 0..)] | ||
_unknown_args: Vec<String>, | ||
} | ||
|
||
const DEPRECATED: &str = "The command you tried to run has been moved into its own CLI extension called near-validator.\nPlease, follow the installation instructions here: https://github.com/near-cli-rs/near-validator-cli-rs/blob/master/README.md"; | ||
|
||
impl ValidatorsArgs { | ||
pub fn to_cli_args(&self, _network_config: String) -> Vec<String> { | ||
eprintln!("\n{}\n", DEPRECATED.to_string().yellow()); | ||
vec!["near-validator".to_string()] | ||
} | ||
} | ||
|
||
impl StakeArgs { | ||
pub fn to_cli_args(&self, _network_config: String) -> Vec<String> { | ||
eprintln!("\n{}\n", DEPRECATED.to_string().yellow()); | ||
vec!["near-validator".to_string()] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters