pub struct RepoCreateCommand { /* private fields */ }
Expand description
Command for creating a repository
Implementations§
Source§impl RepoCreateCommand
impl RepoCreateCommand
Sourcepub fn public(self) -> Self
pub fn public(self) -> Self
Set repository visibility to public
Examples found in repository?
examples/repo.rs (line 10)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GhClient::new();
5 println!("Creating a new repository:");
6 match client
7 .repo()
8 .create("gh-cli-rs")
9 .description("A wrapper for GitHub CLI in Rust")
10 .public()
11 .with_readme()
12 .execute()
13 {
14 Ok(result) => println!("✓ Repository created: {}", result),
15 Err(e) => eprintln!("✗ Error: {}", e),
16 }
17
18 Ok(())
19}
Sourcepub fn description(self, desc: &str) -> Self
pub fn description(self, desc: &str) -> Self
Add a description
Examples found in repository?
examples/repo.rs (line 9)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GhClient::new();
5 println!("Creating a new repository:");
6 match client
7 .repo()
8 .create("gh-cli-rs")
9 .description("A wrapper for GitHub CLI in Rust")
10 .public()
11 .with_readme()
12 .execute()
13 {
14 Ok(result) => println!("✓ Repository created: {}", result),
15 Err(e) => eprintln!("✗ Error: {}", e),
16 }
17
18 Ok(())
19}
Sourcepub fn with_readme(self) -> Self
pub fn with_readme(self) -> Self
Initialize with a README
Examples found in repository?
examples/repo.rs (line 11)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GhClient::new();
5 println!("Creating a new repository:");
6 match client
7 .repo()
8 .create("gh-cli-rs")
9 .description("A wrapper for GitHub CLI in Rust")
10 .public()
11 .with_readme()
12 .execute()
13 {
14 Ok(result) => println!("✓ Repository created: {}", result),
15 Err(e) => eprintln!("✗ Error: {}", e),
16 }
17
18 Ok(())
19}
Sourcepub fn execute(&self) -> Result<String>
pub fn execute(&self) -> Result<String>
Execute the create command
Examples found in repository?
examples/repo.rs (line 12)
3fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let client = GhClient::new();
5 println!("Creating a new repository:");
6 match client
7 .repo()
8 .create("gh-cli-rs")
9 .description("A wrapper for GitHub CLI in Rust")
10 .public()
11 .with_readme()
12 .execute()
13 {
14 Ok(result) => println!("✓ Repository created: {}", result),
15 Err(e) => eprintln!("✗ Error: {}", e),
16 }
17
18 Ok(())
19}
Trait Implementations§
Source§impl GhCommand for RepoCreateCommand
impl GhCommand for RepoCreateCommand
Auto Trait Implementations§
impl Freeze for RepoCreateCommand
impl RefUnwindSafe for RepoCreateCommand
impl Send for RepoCreateCommand
impl Sync for RepoCreateCommand
impl Unpin for RepoCreateCommand
impl UnwindSafe for RepoCreateCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more