Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-279

Support a syntax for embedding QBS variables within command-line arguments.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • some future version
    • 1.0.0
    • General
    • None

    Description

      QBS should support a syntax for passing the values of its own variables on the command line by expanding identifiers (i.e. alphanumeric + underscore, cannot start with digit) prefixed with '@' into the value of qbs.whatever

      For example, @targetOS would be expanded to the value of qbs.targetOS.

      As an example of a use case, perhaps a user wants their install directory to be named according to the platform and architecture. They should be able to write:

      qbs install --install-root builds/@targetOS-@architecture
      

      and, assuming they are running on a 64-bit Linux system, expect their build to be installed to builds/linux-x86_64.

      Some things to think about:

      • Do we support expansion of variables beyond just qbs.*?
      • If we do allow this, are there potential problems with recursive definitions? i.e. can running a command with a @foo variable be dependent on the result of running such a command?
      • How can we provide some sort of escaping syntax? Perhaps the user wants to literally embed @something in a command-line; they should have a way to do so - perhaps \@something or @@something
      • If a variable is undefined should it be an error or return the string 'undefined'? I'd go for the former

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            jakepetroules Jake Petroules (DO NOT ASSIGN ISSUES)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes