positional instead of options
This commit is contained in:
parent
4d5ed64ac3
commit
893bf31fec
@ -9,20 +9,21 @@ use uuid::Uuid;
|
|||||||
use web3_proxy::frontend::authorization::RpcSecretKey;
|
use web3_proxy::frontend::authorization::RpcSecretKey;
|
||||||
|
|
||||||
/// change a user's tier.
|
/// change a user's tier.
|
||||||
/// TODO: we probably shouldn't be exposing the RpcSecretKeys at all. Better to take a user/key id
|
|
||||||
#[derive(FromArgs, PartialEq, Eq, Debug)]
|
#[derive(FromArgs, PartialEq, Eq, Debug)]
|
||||||
#[argh(subcommand, name = "change_user_tier_by_key")]
|
#[argh(subcommand, name = "change_user_tier_by_key")]
|
||||||
pub struct ChangeUserTierByKeyCommand {
|
pub struct ChangeUserTierByKeyCommand {
|
||||||
#[argh(option)]
|
#[argh(positional)]
|
||||||
/// the RPC key owned by the user you want to change.
|
/// the RPC key owned by the user you want to change.
|
||||||
rpc_secret_key: RpcSecretKey,
|
rpc_secret_key: RpcSecretKey,
|
||||||
|
|
||||||
/// the title of the desired user tier.
|
/// the title of the desired user tier.
|
||||||
#[argh(option)]
|
#[argh(positional)]
|
||||||
user_tier_title: String,
|
user_tier_title: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ChangeUserTierByKeyCommand {
|
impl ChangeUserTierByKeyCommand {
|
||||||
|
// TODO: don't expose the RpcSecretKeys at all. Better to take a user/key id. this is definitely most convenient
|
||||||
|
|
||||||
pub async fn main(self, db_conn: &DatabaseConnection) -> anyhow::Result<()> {
|
pub async fn main(self, db_conn: &DatabaseConnection) -> anyhow::Result<()> {
|
||||||
let rpc_secret_key: Uuid = self.rpc_secret_key.into();
|
let rpc_secret_key: Uuid = self.rpc_secret_key.into();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user