-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from worldbank/issue-124-ietoolkit-command
Issue #124 i- create ietoolkit command and edit iefolder so that master dofiles take advantage of this command
- Loading branch information
Showing
3 changed files
with
120 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
*! version 5.4 15DEC2017 DIME Analytics lcardosodeandrad@worldbank.org | ||
|
||
capture program drop ietoolkit | ||
program ietoolkit, rclass | ||
|
||
* UPDATE THESE LOCALS FOR EACH NEW VERSION PUBLISHED | ||
local version "5.4" | ||
local versionDate "15DEC2017" | ||
|
||
|
||
syntax [anything] | ||
|
||
/********************** | ||
Error messages | ||
**********************/ | ||
|
||
* Make sure that no arguments were passed | ||
if "`anything'" != "" { | ||
noi di as error "This command does not take any arguments, write only {it:ietoolkit}" | ||
error 198 | ||
} | ||
|
||
/********************** | ||
Output | ||
**********************/ | ||
|
||
* Prepare returned locals | ||
return local versiondate "`versionDate'" | ||
return scalar version = `version' | ||
|
||
* Display output | ||
noi di "" | ||
noi di _col(4) "This version of ietoolkit installed is version " _col(54)"`version'" | ||
noi di _col(4) "This version of ietoolkit was released on " _col(54)"`versionDate'" | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{smcl} | ||
{* 15 Dec 2017}{...} | ||
{hline} | ||
help for {hi:ietoolkit} | ||
{hline} | ||
|
||
{title:Title} | ||
|
||
{phang}{cmdab:ietoolkit} {hline 2} Returns information on the version of ietoolkit installed | ||
|
||
{phang}For a more descriptive discussion on the intended usage and work flow of this | ||
command please see the {browse "https://dimewiki.worldbank.org/wiki/Ietoolkit":DIME Wiki}. | ||
|
||
{title:Syntax} | ||
|
||
{phang} | ||
{cmdab:ietoolkit} | ||
|
||
{pstd}Note that this command takes no arguments at all.{p_end} | ||
|
||
{marker desc} | ||
{title:Description} | ||
|
||
{pstd}{cmdab:iegraph} This command returns the version of ietoolkit installed. It | ||
can be used in the beginning of a Master Do-file that is intended to be used | ||
by multiple users to programmatically test if ietoolkit is not installed for | ||
the user and therefore need to be installed, or if the version the user has | ||
installed is too old and needs to be upgraded. | ||
|
||
{marker optslong} | ||
{title:Options} | ||
|
||
{phang}This command does not take any options. | ||
|
||
{marker example} | ||
{title:Examples} | ||
|
||
{pstd}The code below is an example code that can be added to the top of any do-file. | ||
the example code first test if the command is installed, and install it if not. If it is | ||
installed, it test if the version is less than version 5.0. If it is, it | ||
replaces the ietoolkit file with the latest version. In your code you can skip | ||
the second part if you are not sure which version is required. But you should | ||
always have the first part testing that {inp:r(version)} has a value before using | ||
it in less than or greater than expressions. | ||
|
||
{inp} cap ietoolkit | ||
{inp} if "`r(version)'" == "" { | ||
{inp} *ietoolkit not installed, install it | ||
{inp} ssc install ietoolkit | ||
{inp} } | ||
{inp} else if `r(version)' < 5.0 { | ||
{inp} ietoolkit version too old, install the latest version | ||
{inp} ssc install ietoolkit , replace | ||
{inp} }{text} | ||
|
||
{title:Acknowledgements} | ||
|
||
{phang}We would like to acknowledge the help in testing and proofreading we received | ||
in relation to this command and help file from (in alphabetic order):{p_end} | ||
{pmore}Luiza Cardoso De Andrade{break}Seungmin Lee{break} | ||
|
||
{title:Authors} | ||
|
||
{phang}Kristoffer Bjarkefur, The World Bank, DECIE | ||
|
||
{phang}Please send bug-reports, suggestions and requests for clarifications | ||
writing "ietoolkit ietoolkit" in the subject line to the email address | ||
found {browse "https://github.com/worldbank/ietoolkit":here} | ||
|
||
{phang}You can also see the code, make comments to the code, see the version | ||
history of the code, and submit additions or edits to the code through | ||
the github repository of ietoolkit:{break} | ||
{browse "https://github.com/worldbank/ietoolkit"} |