schwab_cli/commands/user.rs
1use anyhow::Result;
2use serde_json::json;
3
4use crate::cli::UserCommands;
5use crate::config::RuntimeConfig;
6use crate::output::ResponseEnvelope;
7
8pub async fn run(runtime: &RuntimeConfig, command: UserCommands) -> Result<()> {
9 let api = runtime.build_api()?;
10
11 match command {
12 UserCommands::Preference => {
13 let data = api.user().preference().await?;
14 runtime.emit(ResponseEnvelope::ok("user preference", json!(data)));
15 }
16 }
17
18 Ok(())
19}