Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new API for retrieving a flag's options #75

Closed
rcjsuen opened this issue Mar 27, 2020 · 0 comments
Closed

Create new API for retrieving a flag's options #75

rcjsuen opened this issue Mar 27, 2020 · 0 comments
Assignees

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Mar 27, 2020

The experimental Dockerfile frontends have exposed some new flags for RUN instructions.

# syntax = docker/dockerfile:experimental
FROM ubuntu
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt --mount=type=cache,target=/var/lib/apt \
  apt update && apt-get --no-install-recommends install -y gcc

We should expose an API on Flag so that we can retrieve the options and their corresponding values. We can do this by exposing a new FlagOption type that can be retrieved from Flag.

interface FlagOption {
    public getName(): string;
    public getValue(): string | null;
    public getNameRange(): Range;
    public getValueRange(): Range | null;
    public getRange(): Range;
}
interface Flag {

    public getOption(name: string): FlagOption | null;

    public getOptions(): FlagOption[];

}
@rcjsuen rcjsuen self-assigned this Mar 27, 2020
rcjsuen added a commit that referenced this issue Apr 2, 2020
Signed-off-by: Remy Suen <remy.suen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant