This repository was archived by the owner on Dec 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Wrap existing haskell cli #8
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
053aedd
Add write output utilities
bgins 1812fdd
Add prepare arguments helper
bgins 50e5afe
Add wrapped setup command
bgins 3bd84cd
Add wrapped user whoami command
bgins b1a485b
Add wrapped user login command
bgins e1ebdff
Add whoami shortcut
bgins d389c50
Add wrapped app register command
bgins 5fec1bc
Add prepare flags helper
bgins fd8466d
Add wrapped app publish command
bgins 5d35b2b
Add wrapped app info command
bgins b609a1e
Add wrapped app delegate command
bgins 7df9355
Fix typo in arg name
bgins 797e079
Add global verbose flag
bgins c7945ed
Add missing --
bgins 27af339
Add global remote argument
bgins 4f48f7c
Convert prepare helpers to use HashMap
bgins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,8 +1,35 @@ | ||
| use crate::legacy::{prepare_args, prepare_flags}; | ||
| use anyhow::Result; | ||
| use clap::Args; | ||
| use std::{collections::HashMap, process::Command}; | ||
|
|
||
| #[derive(Args)] | ||
| struct Setup {} | ||
|
|
||
| pub fn run_command(username: Option<String>) { | ||
| todo!("setup --username={:?}", username) | ||
| pub fn run_command( | ||
| username: Option<String>, | ||
| email: Option<String>, | ||
| keyfile: Option<String>, | ||
| os: Option<String>, | ||
| verbose: bool, | ||
| remote: Option<String>, | ||
| ) -> Result<()> { | ||
| let args = prepare_args(&HashMap::from([ | ||
| ("-u", username.as_ref()), | ||
| ("-e", email.as_ref()), | ||
| ("-k", keyfile.as_ref()), | ||
| ("--os", os.as_ref()), | ||
| ])); | ||
| let remote = prepare_args(&HashMap::from([("-R", remote.as_ref())])); | ||
| let flags = prepare_flags(&HashMap::from([("-v", verbose)])); | ||
|
|
||
| Command::new("fission") | ||
| .arg("setup") | ||
| .args(args) | ||
| .args(remote) | ||
| .args(flags) | ||
| .spawn()? | ||
| .wait()?; | ||
|
|
||
| Ok(()) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The remote arg must come after the other args, but before flags for compatibility with the existing CLI.