amber-lang / amber-lang/amber

[Feature] extra options for builtins and stdlib functions

Aberta
#987 2 comentários 0 reações 0 responsáveis Ver no GitHub
compiler pr/stalled stdlib syntax
Linguagem predominante
Rust
Estrelas
5.2k
Forks
145
Merge médio
5d 3h
PRs com merge (30d)
7

Descrição

**Is your feature request related to a problem? Please describe.**
current and future builtins and stdlib functions are and will lack ability to use custom options provided by the commands, and this limits usage of such builtins, since you can't add/enable specific option you'd usually add when using command directly

**Describe the solution you'd like**
command options structure:
```
mv("file.ab", "newdir", {
verbose: true,
force: true
})
// would generate:
// mv "file.ab" -T "newdir" --force --verbose

mv("file.ab", "newdir", {
backup: "backupfile.ab",
f: true
})
// would generate:
// mv "file.ab" -T "newdir" -f --backup="backupfile.ab"
```

**Describe alternatives you've considered**
```
mv("file.ab", "newdir", backup: "backupfile.ab", f)```
// mv "file.ab" -T "newdir" --backup="backupfile.ab" -f

mv("file.ab", "newdir", "--backup=backupfile.ab", "-f")```
// mv "file.ab" -T "newdir" --backup="backupfile.ab" -f
```
**Additional context**
this is just for the future, when we will get structures and enums to properly parse extra options, but builtins could theoretically parse this on compiler side

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.