diff options
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/cursor.rs | 12 | ||||
-rw-r--r-- | src/actions/gen_completions.rs | 16 | ||||
-rw-r--r-- | src/actions/get.rs | 6 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/actions/cursor.rs b/src/actions/cursor.rs index 59fd418..b15ffed 100644 --- a/src/actions/cursor.rs +++ b/src/actions/cursor.rs @@ -15,8 +15,8 @@ pub struct CursorArgs { arg_enum! { #[derive(Debug)] pub enum CursorDirection { - next, - prev, + Next, + Prev, } } @@ -32,8 +32,8 @@ pub fn do_cursor(args: &CursorArgs) -> KhResult<()> { //println!("stdin is tty") if let Some(direction) = &args.direction { match direction { - CursorDirection::prev => return cursor_sequence_move(&Direction::Up), - CursorDirection::next => return cursor_sequence_move(&Direction::Down), + CursorDirection::Prev => return cursor_sequence_move(&Direction::Up), + CursorDirection::Next => return cursor_sequence_move(&Direction::Down), } }; } @@ -110,7 +110,7 @@ mod integration { #[test] fn test_cursor_sequence_move_next() { let testdir = testutils::prepare_testdir("testdir_with_seq_and_cursor"); - let args = CursorArgs{direction: Some(CursorDirection::next)}; + let args = CursorArgs{direction: Some(CursorDirection::Next)}; do_cursor(&args).unwrap(); let out = "1182988800 rfc_multi_day_allday.ics"; @@ -121,7 +121,7 @@ mod integration { #[test] fn test_cursor_sequence_move_prev_at_end() { let testdir = testutils::prepare_testdir("testdir_with_seq_and_cursor"); - let args = CursorArgs{direction: Some(CursorDirection::prev)}; + let args = CursorArgs{direction: Some(CursorDirection::Prev)}; do_cursor(&args).unwrap(); let out = "1544740200 twodaysacrossbuckets.ics\n"; diff --git a/src/actions/gen_completions.rs b/src/actions/gen_completions.rs index b4c1946..e8e11ca 100644 --- a/src/actions/gen_completions.rs +++ b/src/actions/gen_completions.rs @@ -15,10 +15,10 @@ pub struct GenCompletionsArgs { arg_enum! { #[derive(Debug)] pub enum ShellArg{ - bash, - zsh, - fish, - elvish + Bash, + Zsh, + Fish, + Elvish } } @@ -26,10 +26,10 @@ pub fn gen_completions(args: &GenCompletionsArgs) -> KhResult<()> { let mut app = CommandLine::clap(); let binary_name = "khaleesi"; match args.shell { - ShellArg::bash => app.gen_completions_to(binary_name, Shell::Bash, &mut io::stdout()), - ShellArg::zsh => app.gen_completions_to(binary_name, Shell::Zsh, &mut io::stdout()), - ShellArg::fish => app.gen_completions_to(binary_name, Shell::Fish, &mut io::stdout()), - ShellArg::elvish => app.gen_completions_to(binary_name, Shell::Elvish, &mut io::stdout()), + ShellArg::Bash => app.gen_completions_to(binary_name, Shell::Bash, &mut io::stdout()), + ShellArg::Zsh => app.gen_completions_to(binary_name, Shell::Zsh, &mut io::stdout()), + ShellArg::Fish => app.gen_completions_to(binary_name, Shell::Fish, &mut io::stdout()), + ShellArg::Elvish => app.gen_completions_to(binary_name, Shell::Elvish, &mut io::stdout()), } Ok(()) } diff --git a/src/actions/get.rs b/src/actions/get.rs index 2b3b21f..513c0b3 100644 --- a/src/actions/get.rs +++ b/src/actions/get.rs @@ -12,13 +12,13 @@ pub struct GetArgs { arg_enum! { #[derive(Debug)] pub enum GetQueryArgs{ - calendars, + Calendars, } } pub fn action_get(args: &GetArgs) -> KhResult<()> { match args.query { - GetQueryArgs::calendars => action_get_calendars(), + GetQueryArgs::Calendars => action_get_calendars(), } } @@ -41,7 +41,7 @@ mod integration { fn test_get_calendars() { let _testdir = testutils::prepare_testdir("testdir_two_cals"); - let args = GetArgs { query: GetQueryArgs::calendars }; + let args = GetArgs { query: GetQueryArgs::Calendars }; action_get(&args).unwrap(); assert_eq!("first\nsecond\nsecond/second_sub\n", stdioutils::test_stdout_clear()); |