mirror of
https://github.com/sagiegurari/duckscript
synced 2024-10-06 08:02:06 +00:00
Rename read/write text file commands
This commit is contained in:
parent
d46d51d651
commit
242eb33551
|
@ -2,8 +2,9 @@
|
|||
|
||||
### v0.1.9
|
||||
|
||||
* New base64_decode command.
|
||||
* New base64_encode command.
|
||||
* Rename read/write text file commands.
|
||||
* New base64_decode command #75
|
||||
* New base64_encode command #75
|
||||
* New bytes_to_string command.
|
||||
* New string_to_bytes command.
|
||||
* Add prefix flag to write_properties command #77
|
||||
|
|
16
docs/sdk.md
16
docs/sdk.md
|
@ -53,8 +53,8 @@
|
|||
* [std::fs::List (ls)](#std__fs__List)
|
||||
* [std::fs::MovePath (mv)](#std__fs__MovePath)
|
||||
* [std::fs::Print (cat)](#std__fs__Print)
|
||||
* [std::fs::Read (readfile)](#std__fs__Read)
|
||||
* [std::fs::Write (writefile)](#std__fs__Write)
|
||||
* [std::fs::ReadText (readfile, read_text_file)](#std__fs__ReadText)
|
||||
* [std::fs::WriteText (writefile, write_text_file)](#std__fs__WriteText)
|
||||
* [std::math::Calc (calc)](#std__math__Calc)
|
||||
* [std::math::GreaterThan (greater_than)](#std__math__GreaterThan)
|
||||
* [std::math::LessThan (less_than)](#std__math__LessThan)
|
||||
|
@ -2000,8 +2000,8 @@ cat ./docs/sdk.md
|
|||
#### Aliases:
|
||||
cat
|
||||
|
||||
<a name="std__fs__Read"></a>
|
||||
## std::fs::Read
|
||||
<a name="std__fs__ReadText"></a>
|
||||
## std::fs::ReadText
|
||||
```sh
|
||||
var = readfile file
|
||||
```
|
||||
|
@ -2024,10 +2024,10 @@ text = readfile ./Cargo.toml
|
|||
|
||||
|
||||
#### Aliases:
|
||||
readfile
|
||||
readfile, read_text_file
|
||||
|
||||
<a name="std__fs__Write"></a>
|
||||
## std::fs::Write
|
||||
<a name="std__fs__WriteText"></a>
|
||||
## std::fs::WriteText
|
||||
```sh
|
||||
result = writefile file text
|
||||
```
|
||||
|
@ -2052,7 +2052,7 @@ out = writefile ./target/tests/writefile.txt "line 1\nline 2"
|
|||
|
||||
|
||||
#### Aliases:
|
||||
writefile
|
||||
writefile, write_text_file
|
||||
|
||||
<a name="std__math__Calc"></a>
|
||||
## std::math::Calc
|
||||
|
|
|
@ -7,11 +7,11 @@ mod list;
|
|||
mod mkdir;
|
||||
mod mv;
|
||||
mod print;
|
||||
mod read;
|
||||
mod read_text;
|
||||
mod rm;
|
||||
mod rmdir;
|
||||
mod touch;
|
||||
mod write;
|
||||
mod write_text;
|
||||
|
||||
use crate::utils::pckg;
|
||||
use duckscript::types::command::Commands;
|
||||
|
@ -31,11 +31,11 @@ pub(crate) fn load(commands: &mut Commands, parent: &str) -> Result<(), ScriptEr
|
|||
commands.set(mkdir::create(&package))?;
|
||||
commands.set(mv::create(&package))?;
|
||||
commands.set(print::create(&package))?;
|
||||
commands.set(read::create(&package))?;
|
||||
commands.set(read_text::create(&package))?;
|
||||
commands.set(rm::create(&package))?;
|
||||
commands.set(rmdir::create(&package))?;
|
||||
commands.set(touch::create(&package))?;
|
||||
commands.set(write::create(&package))?;
|
||||
commands.set(write_text::create(&package))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@ pub(crate) struct CommandImpl {
|
|||
|
||||
impl Command for CommandImpl {
|
||||
fn name(&self) -> String {
|
||||
pckg::concat(&self.package, "Read")
|
||||
pckg::concat(&self.package, "ReadText")
|
||||
}
|
||||
|
||||
fn aliases(&self) -> Vec<String> {
|
||||
vec!["readfile".to_string()]
|
||||
vec!["readfile".to_string(), "read_text_file".to_string()]
|
||||
}
|
||||
|
||||
fn help(&self) -> String {
|
|
@ -12,11 +12,11 @@ pub(crate) struct CommandImpl {
|
|||
|
||||
impl Command for CommandImpl {
|
||||
fn name(&self) -> String {
|
||||
pckg::concat(&self.package, "Write")
|
||||
pckg::concat(&self.package, "WriteText")
|
||||
}
|
||||
|
||||
fn aliases(&self) -> Vec<String> {
|
||||
vec!["writefile".to_string()]
|
||||
vec!["writefile".to_string(), "write_text_file".to_string()]
|
||||
}
|
||||
|
||||
fn help(&self) -> String {
|
Loading…
Reference in a new issue