Marcel van Lohuizen | f813285 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 1 | // Copyright 2018 The CUE Authors |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Marcel van Lohuizen | f813285 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 15 | package tool |
| 16 | |
| 17 | // A Command specifies a user-defined command. |
| 18 | Command: { |
| 19 | // |
| 20 | // Example: |
| 21 | // mycmd [-n] names |
| 22 | usage?: string |
| 23 | |
| 24 | // short is short description of what the command does. |
| 25 | short?: string |
| 26 | |
| 27 | // long is a longer description that spans multiple lines and |
| 28 | // likely contain examples of usage of the command. |
| 29 | long?: string |
| 30 | |
Marcel van Lohuizen | 928bfa3 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 31 | // TODO: define flags and environment variables. |
Marcel van Lohuizen | f813285 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 32 | |
| 33 | // tasks specifies the list of things to do to run command. Tasks are |
| 34 | // typically underspecified and completed by the particular internal |
| 35 | // handler that is running them. Task de |
| 36 | tasks <name>: Task |
Marcel van Lohuizen | f813285 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 37 | } |
| 38 | |
Marcel van Lohuizen | 928bfa3 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 39 | // A Task defines a step in the execution of a command. |
Marcel van Lohuizen | f813285 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 40 | Task: { |
Marcel van Lohuizen | 928bfa3 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 41 | // kind indicates the operation to run. It must be of the form |
| 42 | // packagePath.Operation. |
Marcel van Lohuizen | f813285 | 2019-04-26 12:16:18 +0200 | [diff] [blame] | 43 | kind: =~#"\."# |
| 44 | } |