You seem to be arguing about 2 completely separate things; how do we
switch between command shells and secondly how should we define which
CamelContext object from a potential list of things the various camel
commands operate on.

In terms of switching shells, I don't see why the shell name can't be
used as a command & proper error reporting used if folks tab complete
or mistype a command.  Worst case "shell camel" would be fine I think.

In terms of defining the camel context ID used for the camel commands;
sure that'd be either a variable in the shell, an argument/option to
the commands or some kind of camel:setcontext command. I wasn't
proposing typing in the camelContext ID from JMX and have that start a
sub shell if thats what you thought I meant.


On 17 May 2011 15:17, mikevan <[email protected]> wrote:
> I think its still misleading. What do we do if Camel's feature repository has
> a "camel" feature defined?  While we can ensure that camel doesn't define a
> "camel" feature, this wont' always be the case. Also, how do we handle the
> event where a user types in a command that isn't defined, do we always
> assume that command is a context?  This will make it difficult to debug.  If
> a user fat-fingers a command, and they get an error stating that "command"
> doesn't exist as a context, it will not tell them what the actual issue is
> (the command they typed doesn't exist).  For these reasons, I suggest we
> make switching contexts more obvious.
>
> karaf@root>  ctx:switchContext camel
> karaf@root> #camel> route:list
> karaf@root> #camel> ctx:switchContext root
> karaf@root> la
>
> By creating a command that specifically switches the context, we are making
> it clear to the system user exactly what they are doing, and we can provide
> errors based on the switching of a context.
>
>
>
> James Strachan-2 wrote:
>>
>> Maybe you need to define a variable for the camel context ID that the
>> camel shell uses when listing stuff?
>>
>> On 17 May 2011 09:53, Claus Ibsen &lt;[email protected]&gt; wrote:
>>> On Tue, May 17, 2011 at 10:32 AM, James Strachan
>>> &lt;[email protected]&gt; wrote:
>>>> To feel more unixy, why not just use the name of the shell as the
>>>> command?
>>>>
>>>> karaf@root> camel
>>>> karaf@root> #camel> route:list
>>>> karaf@root> #camel> route:stop
>>>> karaf@root> exit
>>>> karaf@root> ace
>>>> karaf@root> #ace> distribution:list
>>>> karaf@root> exit
>>>>
>>>> Or failing that "shell" would seem a good choice
>>>>
>>>> karaf@root> shell camel
>>>> karaf@root> #camel> route:list
>>>> karaf@root> #camel> route:stop
>>>> karaf@root> exit
>>>> karaf@root> shell ace
>>>> karaf@root> #ace> distribution:list
>>>> karaf@root> exit
>>>>
>>>>
>>>
>>> So if I have 3 camel apps in Karaf.
>>>
>>> And they each have an unique camel id. Lets call them
>>>
>>> wicketCamel
>>> fooCamel
>>> barCamel
>>>
>>> So what would that shell command exactly be?
>>>
>>> shell wicketCamel
>>> shell camel
>>> shell camel wicketCamel
>>>
>>> I guess you can either go into
>>> - camel mode without having picked a specific camel context to use
>>> - camel mode having picked a specific context
>>>
>>> Or is that overkill
>>>
>>> shell camel -> camel mode without picking a specific camel context
>>> shell camel wicketCamel -> to pick the wicketCamel app
>>>
>>> So in the latter case, when I do a
>>> route-list
>>>
>>> It only shows the routes from wicketCamel
>>>
>>>
>>>
>>>
>>>> On 17 May 2011 09:22, Ioannis Canellos &lt;[email protected]&gt; wrote:
>>>>> +1 for the idea.
>>>>>
>>>>> I would like to propose however to context switch using an other
>>>>> command
>>>>> instead of "cd" because "cd" will cause confusion. I would propose ctx
>>>>> instead.
>>>>>
>>>>> --
>>>>> *Ioannis Canellos*
>>>>> *
>>>>>  http://iocanel.blogspot.com
>>>>>
>>>>> Apache Karaf &lt;http://karaf.apache.org/&gt; Committer & PMC
>>>>> Apache ServiceMix &lt;http://servicemix.apache.org/&gt;  Committer
>>>>> *
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> James
>>>> -------
>>>> FuseSource
>>>> Email: [email protected]
>>>> Web: http://fusesource.com
>>>> Twitter: jstrachan, fusenews
>>>> Blog: http://macstrac.blogspot.com/
>>>>
>>>> Connect at CamelOne May 24-26
>>>> The Open Source Integration Conference
>>>> http://camelone.com/
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> FuseSource
>>> Email: [email protected]
>>> Web: http://fusesource.com
>>> CamelOne 2011: http://fusesource.com/camelone2011/
>>> Twitter: davsclaus, fusenews
>>> Blog: http://davsclaus.blogspot.com/
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>
>>
>>
>>
>> --
>> James
>> -------
>> FuseSource
>> Email: [email protected]
>> Web: http://fusesource.com
>> Twitter: jstrachan, fusenews
>> Blog: http://macstrac.blogspot.com/
>>
>> Connect at CamelOne May 24-26
>> The Open Source Integration Conference
>> http://camelone.com/
>>
>
>
> -----
> Mike Van (aka karafman)
> Karaf Team (Contributor)
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/PROPOSAL-Shell-commands-context-support-tp2951532p2952678.html
> Sent from the Karaf - Dev mailing list archive at Nabble.com.
>



-- 
James
-------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com/

Reply via email to