Port hash, hash md5 and hash sha256 commands (#464)

`hash` by itself is only printing the help message.

The other two are simply using the same generic implementation.
This commit is contained in:
Benoît Cortier
2021-12-10 18:14:28 -05:00
committed by GitHub
parent 95841e3489
commit e77c6bb284
10 changed files with 408 additions and 49 deletions

View File

@ -9,10 +9,7 @@ pub fn create_default_context() -> EngineState {
let mut working_set = StateWorkingSet::new(&engine_state);
macro_rules! bind_command {
( $command:expr ) => {
working_set.add_decl(Box::new($command));
};
( $( $command:expr ),* ) => {
( $( $command:expr ),* $(,)? ) => {
$( working_set.add_decl(Box::new($command)); )*
};
}
@ -175,7 +172,11 @@ pub fn create_default_context() -> EngineState {
Where,
WithEnv,
Wrap,
Zip
Zip,
// Hash
Hash,
HashMd5::default(),
HashSha256::default(),
);
#[cfg(feature = "plugin")]