Commit
Author: Manos Pitsidianakis [manos@pitsidianak.is]
Hash: ac1349b8507fe192c1a3c1c5c8e6b4384098f520
Timestamp: Sat, 31 Aug 2024 12:41:55 +0000 (4 months ago)

+3 -3 +/-1 browse
command: alias `pwd` to `cwd`
command: alias `pwd` to `cwd`

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
1diff --git a/meli/src/command/parser.rs b/meli/src/command/parser.rs
2index a7b91d7..bf22343 100644
3--- a/meli/src/command/parser.rs
4+++ b/meli/src/command/parser.rs
5 @@ -562,15 +562,15 @@ pub fn printenv(input: &[u8]) -> IResult<&[u8], Result<Action, CommandError>> {
6 Ok((input, Ok(PrintEnv(key.to_string()))))
7 }
8 pub fn currentdir(input: &[u8]) -> IResult<&[u8], Result<Action, CommandError>> {
9- let mut check = arg_init! { min_arg:0, max_arg: 0, currentdir};
10- let (input, _) = tag("cwd")(input.ltrim())?;
11+ let mut check = arg_init! { min_arg:0, max_arg: 0, pwd};
12+ let (input, _) = alt((tag("cwd"), tag("pwd")))(input.ltrim())?;
13 arg_chk!(start check, input);
14 arg_chk!(finish check, input);
15 let (input, _) = eof(input)?;
16 Ok((input, Ok(CurrentDirectory)))
17 }
18 pub fn change_currentdir(input: &[u8]) -> IResult<&[u8], Result<Action, CommandError>> {
19- let mut check = arg_init! { min_arg:1, max_arg: 1, change_currentdir};
20+ let mut check = arg_init! { min_arg: 1, max_arg: 1, cd};
21 let (input, _) = tag("cd")(input.ltrim())?;
22 arg_chk!(start check, input);
23 let (input, _) = is_a(" ")(input)?;