Skip to content

[Feature] extra options for builtins and stdlib functions #987

@Tirito6626

Description

@Tirito6626

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    compilerpr/stalledThis PR is blocked by other PRstdlibRelated to Amber's Standard Librarysyntax

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions