-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
210 additions
and
130 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run Clippy | ||
run: cargo clippy --verbose | ||
- name: Run tests | ||
run: cargo test --verbose |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use clap::{Parser, Subcommand}; | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct DirectoryCli { | ||
#[command(subcommand)] | ||
pub action: DirectoryCommands, | ||
} | ||
|
||
#[derive(Subcommand, Debug)] | ||
pub enum DirectoryCommands { | ||
#[command(alias = "ls")] | ||
List(ListDirectoryArgs), | ||
Start(StartDirectoryArgs), | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct ListDirectoryArgs { | ||
/// Show minimal output for scripts | ||
#[arg(short, long, default_value_t = false)] | ||
pub minimal: bool, | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct StartDirectoryArgs { | ||
/// The directory to start the session in | ||
pub directory: String, | ||
|
||
/// Start the session detached | ||
#[arg(short, long, default_value_t = false)] | ||
pub detached: bool, | ||
|
||
/// Specify the name of the tmux session | ||
/// | ||
/// Optionally provide a name for the session. If not provided, it will be either the name from the configuration or from the directory | ||
#[arg(short, long)] | ||
pub name: Option<String>, | ||
|
||
/// Always start a new session instead of attaching to an existing session | ||
#[arg(long, default_value_t = false)] | ||
pub always_new_session: bool, | ||
} |
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,33 @@ | ||
pub mod directory; | ||
pub mod template; | ||
|
||
use clap::{Parser, Subcommand}; | ||
use self::{directory::DirectoryCli, template::TemplateCli}; | ||
|
||
// TODO: Make a `cli`directory with multiple files | ||
|
||
/// A CLI for tmux session management | ||
#[derive(Parser, Debug)] | ||
#[clap(version)] | ||
pub struct Cli { | ||
#[command(subcommand)] | ||
pub cmd: Commands, | ||
} | ||
|
||
#[derive(Subcommand, Debug)] | ||
pub enum Commands { | ||
/// Initialize the config | ||
/// | ||
/// This command will initialize your config directories. | ||
Init, | ||
/// Manage directories in the context of muxmate and tmux | ||
/// | ||
/// This command provides functionalities to interact with tmux sessions based on directories. | ||
#[command(alias = "dir", alias = "dirs", alias = "directories")] | ||
Directory(DirectoryCli), | ||
/// Manage templates in the context of muxmate and tmux | ||
/// | ||
/// This command provides functionalities to interact with tmux sessions based on templates | ||
#[command(alias = "temp", alias = "templ")] | ||
Template(TemplateCli), | ||
} |
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,47 @@ | ||
use clap::{Parser, Subcommand}; | ||
use std::path::PathBuf; | ||
#[derive(Parser, Debug)] | ||
pub struct TemplateCli { | ||
#[command(subcommand)] | ||
pub action: TemplateCommands, | ||
} | ||
|
||
#[derive(Subcommand, Debug)] | ||
pub enum TemplateCommands { | ||
#[command(alias = "ls")] | ||
List(ListTemplateArgs), | ||
Start(StartTemplateArgs), | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct ListTemplateArgs { | ||
/// Show minimal output for scripts | ||
#[arg(short, long, default_value_t = false)] | ||
pub minimal: bool, | ||
/// Show all templates including hidden ones | ||
#[arg(short, long, default_value_t = false)] | ||
pub all: bool, | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct StartTemplateArgs { | ||
pub template_name: String, | ||
|
||
/// Start the session detached | ||
#[arg(short, long, default_value_t = false)] | ||
pub detached: bool, | ||
|
||
/// The directory to start it in | ||
#[arg(long, alias = "dir")] | ||
pub directory: Option<PathBuf>, | ||
|
||
/// Specify the name of the tmux session | ||
/// | ||
/// Optionally provide a name for the session. If not provided, it will be either the name from the configuration or from the directory | ||
#[arg(short, long)] | ||
pub name: Option<String>, | ||
|
||
/// Always start a new session instead of attaching to an existing session | ||
#[arg(long, default_value_t = false)] | ||
pub always_new_session: bool, | ||
} |
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
Oops, something went wrong.