Add a raw output option to a property queried with "wsk property get"
- Lingua principale
- Go
- Stelle
- 109
- Fork
- 98
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
@l2fprod commented on [Mon Nov 14 2016](https://github.com/apache/incubator-openwhisk/issues/1503)
When called with no arguments, `wsk property get` shows a table like output:
```
whisk auth BLAH
whisk API host openwhisk.ng.bluemix.net
whisk API version v1
whisk namespace frederic.lavigne@fr.ibm.com_openwhisk-vision
whisk CLI version 2016-10-24T11:55:02+00:00
whisk API build 2016-11-08T13:28:31Z
whisk API build number whisk-build-1683
```
Let's say I want to retrieve the namespace, I can use `wsk property get --namespace`. This output:
```
whisk namespace frederic.lavigne@fr.ibm.com_openwhisk-vision
```
Now I have to parse this output to isolate the namespace. This leads to extra `awk` calls like we can see in several advanced OpenWhisk tutorials https://github.com/IBM-Bluemix/openwhisk-darkvisionapp/blob/master/processing/deploy-darkvision.sh, https://github.com/skaegi/openwhisk-package-pipeline/blob/master/deploy.sh
This would go away if the output of the get command was exactly the value of the property with no extra formatting sugar. So instead of
```
CURRENT_NAMESPACE=`wsk property get --namespace | awk '{print $3}'`
```
I would just do
```
CURRENT_NAMESPACE=`wsk property get --namespace`
```
More readable and less error prone - what if OpenWhisk decides to change the formatting of the output adding more words or spaces, my $3 would no longer match the namespace.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia individuando l’implementazione Go di `wsk property get` e tutti i test che ne coprono l’output. Confronta l’output formattato attuale con il comportamento richiesto per il valore non elaborato; il lavoro è completato quando un’opzione di output non elaborato restituisce solo il valore della proprietà selezionata, mentre l’output tabellare esistente rimane invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- go
- Ambito
- cli
- Tipo di issue
- Funzionalità
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100