You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Lijun Liao (JIRA)" <ji...@apache.org> on 2018/02/19 10:40:00 UTC

[jira] [Updated] (KARAF-5629) Add new karaf commands shell:elif and shell:else

     [ https://issues.apache.org/jira/browse/KARAF-5629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lijun Liao updated KARAF-5629:
------------------------------
    Description: 
Take the following example:
{code:java}
if {"$v" equals "a"} {
  do something a
} {
  if {"$v" equals "b"} {
    do something b
  } {
    if {"$v" equals "c"} {
      do something c
    } {
      do something others
    }
  }
}
{code}
By introducing the commands shell:elif and shell:else, this can be simplified as follows:
{code:java}
if {"$v" equals "a"} {
  do something a
} elif {"$v" equals "b"} {
  do something b
} elif {"$v" equals "c"} {
  do something c
} else {
  do something others
}
{code}

  was:
Take the following example:
{code:java}
if {"$v" equals "a"} {
  do something a
} {
  if {"$v" equals "b"} {
    do something b
  } {
    if {"$v" equals "c"} {
      do something c
    } {
      do something others
    }
  }
}
{code}
 

By introducing the commands shell:elif and shell:else, this can be simplified as follows: 
{code:java}
if {"$v" equals "a"} {
  do something a
} elif {"$v" equals "b"} {
  do something b
} elif {"$v" equals "c"} {
  do something c
} else {
  do something others
}
{code}
 

 


> Add new karaf commands shell:elif and shell:else
> ------------------------------------------------
>
>                 Key: KARAF-5629
>                 URL: https://issues.apache.org/jira/browse/KARAF-5629
>             Project: Karaf
>          Issue Type: New Feature
>          Components: karaf-shell
>    Affects Versions: 4.1.5, 4.2.0.M2
>            Reporter: Lijun Liao
>            Priority: Minor
>             Fix For: 4.2.0, 4.1.6
>
>
> Take the following example:
> {code:java}
> if {"$v" equals "a"} {
>   do something a
> } {
>   if {"$v" equals "b"} {
>     do something b
>   } {
>     if {"$v" equals "c"} {
>       do something c
>     } {
>       do something others
>     }
>   }
> }
> {code}
> By introducing the commands shell:elif and shell:else, this can be simplified as follows:
> {code:java}
> if {"$v" equals "a"} {
>   do something a
> } elif {"$v" equals "b"} {
>   do something b
> } elif {"$v" equals "c"} {
>   do something c
> } else {
>   do something others
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)