You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by chris snow <ch...@gmail.com> on 2014/04/19 17:02:03 UTC

shell style guide for stratos?

Hi Guys,

What do you think to aligning with google's shell style guide [1] for
Stratos shell scripts?

Is there a better style guide that you are aware of?

Many thanks,

Chris

---
[1] https://google-styleguide.googlecode.com/svn/trunk/shell.xml

Re: shell style guide for stratos?

Posted by chris snow <ch...@gmail.com>.
hi Shaheedur,  definitely agree.  I would see the Google style guide
being our base guide, that we would supplement with other rules such
as how we do error handling.

On Fri, Apr 25, 2014 at 12:02 AM, Shaheedur Haque (shahhaqu)
<sh...@cisco.com> wrote:
>
> IMHO, more important that the style guide would be some consistent approach
> to error handling. FWIW, we try to use a block of statements like this in
> each shell script:
>
> ==========
> declare infomsg=%%${0##*/}-Info:
> declare errmsg=%%${0##*/}-Error:
> set -o pipefail
> set -o errtrace
> set -o nounset
> trap "echo $errmsg trap on error near line \$LINENO; exit 1" ERR
> ==========
>
> I'm sure others have their favourites too...
>
>
>
> ________________________________
> From: Dinesh Bandara [dineshb@wso2.com]
> Sent: 21 April 2014 04:09
> To: dev@stratos.incubator.apache.org
> Subject: Re: shell style guide for stratos?
>
> +1. this will added standards to stratos shell scripts.
>
>
> On Sun, Apr 20, 2014 at 8:14 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>
>>
>> +1 that style is good I think.
>>
>>
>> Touched, not typed. Erroneous words are a feature, not a typo.a
>>
>> On Apr 20, 2014 10:46 AM, "Afkham Azeez" <af...@gmail.com> wrote:
>>>
>>> +1. This would be a great addition.
>>>
>>>
>>> On Sat, Apr 19, 2014 at 8:32 PM, chris snow <ch...@gmail.com> wrote:
>>>>
>>>> Hi Guys,
>>>>
>>>> What do you think to aligning with google's shell style guide [1] for
>>>> Stratos shell scripts?
>>>>
>>>> Is there a better style guide that you are aware of?
>>>>
>>>> Many thanks,
>>>>
>>>> Chris
>>>>
>>>> ---
>>>> [1] https://google-styleguide.googlecode.com/svn/trunk/shell.xml
>>>
>>>
>>>
>>>
>>> --
>>> Afkham Azeez
>>> Director of Architecture; WSO2, Inc.; http://wso2.com,
>>> Member; Apache Software Foundation; http://www.apache.org/
>>>
>>> email: azeez@wso2.com cell: +94 77 3320919
>>> blog: http://blog.afkham.org
>>> twitter: http://twitter.com/afkham_azeez
>>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>>>
>>> Lean . Enterprise . Middleware
>>>
>
>
>
> --
> Dinesh Bandara
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>



-- 
Check out my professional profile and connect with me on LinkedIn.
http://lnkd.in/cw5k69

RE: shell style guide for stratos?

Posted by "Shaheedur Haque (shahhaqu)" <sh...@cisco.com>.
IMHO, more important that the style guide would be some consistent approach to error handling. FWIW, we try to use a block of statements like this in each shell script:

==========
declare infomsg=%%${0##*/}-Info:
declare errmsg=%%${0##*/}-Error:
set -o pipefail
set -o errtrace
set -o nounset
trap "echo $errmsg trap on error near line \$LINENO; exit 1" ERR
==========

I'm sure others have their favourites too...



________________________________
From: Dinesh Bandara [dineshb@wso2.com]
Sent: 21 April 2014 04:09
To: dev@stratos.incubator.apache.org
Subject: Re: shell style guide for stratos?

+1. this will added standards to stratos shell scripts.


On Sun, Apr 20, 2014 at 8:14 PM, Udara Liyanage <ud...@wso2.com>> wrote:

+1 that style is good I think.



Touched, not typed. Erroneous words are a feature, not a typo.a

On Apr 20, 2014 10:46 AM, "Afkham Azeez" <af...@gmail.com>> wrote:
+1. This would be a great addition.


On Sat, Apr 19, 2014 at 8:32 PM, chris snow <ch...@gmail.com>> wrote:
Hi Guys,

What do you think to aligning with google's shell style guide [1] for
Stratos shell scripts?

Is there a better style guide that you are aware of?

Many thanks,

Chris

---
[1] https://google-styleguide.googlecode.com/svn/trunk/shell.xml



--
Afkham Azeez
Director of Architecture; WSO2, Inc.; http://wso2.com,
Member; Apache Software Foundation; http://www.apache.org/

email: azeez@wso2.com<ma...@wso2.com> cell: +94 77 3320919<tel:%2B94%2077%203320919>
blog: http://blog.afkham.org
twitter: http://twitter.com/afkham_azeez
linked-in: http://lk.linkedin.com/in/afkhamazeez

Lean . Enterprise . Middleware




--
Dinesh Bandara
Software Engineer
WSO2 Inc.; http://wso2.com<http://wso2.com/>
lean.enterprise.middleware


Re: shell style guide for stratos?

Posted by Dinesh Bandara <di...@wso2.com>.
+1. this will added standards to stratos shell scripts.


On Sun, Apr 20, 2014 at 8:14 PM, Udara Liyanage <ud...@wso2.com> wrote:

>
> +1 that style is good I think.
>
>
> Touched, not typed. Erroneous words are a feature, not a typo.a
> On Apr 20, 2014 10:46 AM, "Afkham Azeez" <af...@gmail.com> wrote:
>
>> +1. This would be a great addition.
>>
>>
>> On Sat, Apr 19, 2014 at 8:32 PM, chris snow <ch...@gmail.com> wrote:
>>
>>> Hi Guys,
>>>
>>> What do you think to aligning with google's shell style guide [1] for
>>> Stratos shell scripts?
>>>
>>> Is there a better style guide that you are aware of?
>>>
>>> Many thanks,
>>>
>>> Chris
>>>
>>> ---
>>> [1] https://google-styleguide.googlecode.com/svn/trunk/shell.xml
>>>
>>
>>
>>
>> --
>> *Afkham Azeez*
>> Director of Architecture; WSO2, Inc.; http://wso2.com,
>> *Member; Apache Software Foundation; **http://www.apache.org/*<http://www.apache.org/>
>>
>> *email: **azeez@wso2.com* <az...@wso2.com>
>> * cell: +94 77 3320919 <%2B94%2077%203320919> blog: *
>> *http://blog.afkham.org* <http://blog.afkham.org>
>> *twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>> * linked-in: **http://lk.linkedin.com/in/afkhamazeez
>> <http://lk.linkedin.com/in/afkhamazeez>*
>>
>> *Lean . Enterprise . Middleware*
>>
>>


-- 
*Dinesh Bandara*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Re: shell style guide for stratos?

Posted by Udara Liyanage <ud...@wso2.com>.
+1 that style is good I think.


Touched, not typed. Erroneous words are a feature, not a typo.a
On Apr 20, 2014 10:46 AM, "Afkham Azeez" <af...@gmail.com> wrote:

> +1. This would be a great addition.
>
>
> On Sat, Apr 19, 2014 at 8:32 PM, chris snow <ch...@gmail.com> wrote:
>
>> Hi Guys,
>>
>> What do you think to aligning with google's shell style guide [1] for
>> Stratos shell scripts?
>>
>> Is there a better style guide that you are aware of?
>>
>> Many thanks,
>>
>> Chris
>>
>> ---
>> [1] https://google-styleguide.googlecode.com/svn/trunk/shell.xml
>>
>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com,
> *Member; Apache Software Foundation; **http://www.apache.org/*<http://www.apache.org/>
>
> *email: **azeez@wso2.com* <az...@wso2.com>
> * cell: +94 77 3320919 <%2B94%2077%203320919> blog: *
> *http://blog.afkham.org* <http://blog.afkham.org>
> *twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> * linked-in: **http://lk.linkedin.com/in/afkhamazeez
> <http://lk.linkedin.com/in/afkhamazeez>*
>
> *Lean . Enterprise . Middleware*
>
>

Re: shell style guide for stratos?

Posted by Afkham Azeez <af...@gmail.com>.
+1. This would be a great addition.


On Sat, Apr 19, 2014 at 8:32 PM, chris snow <ch...@gmail.com> wrote:

> Hi Guys,
>
> What do you think to aligning with google's shell style guide [1] for
> Stratos shell scripts?
>
> Is there a better style guide that you are aware of?
>
> Many thanks,
>
> Chris
>
> ---
> [1] https://google-styleguide.googlecode.com/svn/trunk/shell.xml
>



-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com,
*Member; Apache Software Foundation;
**http://www.apache.org/*<http://www.apache.org/>

*email: **azeez@wso2.com* <az...@wso2.com>
* cell: +94 77 3320919 blog: **http://blog.afkham.org*<http://blog.afkham.org>
*twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
* linked-in: **http://lk.linkedin.com/in/afkhamazeez
<http://lk.linkedin.com/in/afkhamazeez>*

*Lean . Enterprise . Middleware*

Re: shell style guide for stratos?

Posted by Nirmal Fernando <ni...@gmail.com>.
None that I'm aware of ... +1 for a some sort of a style!


On Sat, Apr 19, 2014 at 8:32 PM, chris snow <ch...@gmail.com> wrote:

> Hi Guys,
>
> What do you think to aligning with google's shell style guide [1] for
> Stratos shell scripts?
>
> Is there a better style guide that you are aware of?
>
> Many thanks,
>
> Chris
>
> ---
> [1] https://google-styleguide.googlecode.com/svn/trunk/shell.xml
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/