<commit_before>/**
* Copyright (c) Microsoft.  All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var __ = require('underscore');
var async = require('async');
var url = require('url');

/*jshint camelcase:false*/
var child_process = require('child_process');

var interaction = require('../util/interaction');
var utils = require('../util/utils');
var cacheUtils = require('../util/cacheUtils');
var Constants = require('../util/constants');
var kuduscript = require('kuduscript');

var WebsitesClient = require('./websites/websitesclient');

var linkedRevisionControl = require('../util/git/linkedrevisioncontrol');
var validation = require('../util/validation');

exports.init = function (cli) {

  var log = cli.output;

  cli.category('account').registerResourceType('website');

  var site = cli.category('site')
        .description('Commands to manage your Web Sites');

  site.command('list')
        .description('List your web sites')
        .option('-s, --subscription <id>', 'use the subscription id')
        .execute(function (options, _) {
          var parameters = {
            subscription: cli.category('account').lookupSubscriptionId(options.subscription)
          };

          var sites = site.doSitesGet(parameters, _);
          if (sites && sites.length > 0) {
            for (var s in sites) {
              sites[s] = clean(sites[s]);
            }

            var getSiteMode = function (site) {
              if (utils.ignoreCaseEquals(site.ComputeMode, 'dedicated')) {
                return 'Reserved';
              } else if (utils.ignoreCaseEquals(site.SiteMode, 'basic')) {
                return 'Shared';
              }

              return 'Free';
            };

            log.table(sites, function (row, s) {
              row.cell('Name', s.Name);
              row.cell('Status', s.State);
              row.cell('Mode', getSiteMode(s));
              row.cell('Host names', s.HostNames);
            });
          } else {
            log.info('No sites created yet. You can create new sites using "azure site create" or through the portal.');
          }
        });

  site.command('set [name]')
        .description('Sets configuration options for your web site [name]')
        .option('--net-version <net-version>', 'The .NET version. Valid options are v3.5 and v4.5')
        .option('--php-version <php-version>', 'The PHP version. Valid options are off, v5.3 and v5.4')
        .option('--platform <platform>', 'The platform. Valid options are x86 and x64')
        .option('-s, --subscription <id>', 'use the subscription id')
        .execute(function (name, options, _) {
      var context = {
        subscription: cli.category('account').lookupSubscriptionId(options.subscription),<commit_msg>Rename reserved to standard in list<commit_after>/**
* Copyright (c) Microsoft.  All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var __ = require('underscore');
var async = require('async');
var url = require('url');

/*jshint camelcase:false*/
var child_process = require('child_process');

var interaction = require('../util/interaction');
var utils = require('../util/utils');
var cacheUtils = require('../util/cacheUtils');
var Constants = require('../util/constants');
var kuduscript = require('kuduscript');

var WebsitesClient = require('./websites/websitesclient');

var linkedRevisionControl = require('../util/git/linkedrevisioncontrol');
var validation = require('../util/validation');

exports.init = function (cli) {

  var log = cli.output;

  cli.category('account').registerResourceType('website');

  var site = cli.category('site')
        .description('Commands to manage your Web Sites');

  site.command('list')
        .description('List your web sites')
        .option('-s, --subscription <id>', 'use the subscription id')
        .execute(function (options, _) {
          var parameters = {
            subscription: cli.category('account').lookupSubscriptionId(options.subscription)
          };

          var sites = site.doSitesGet(parameters, _);
          if (sites && sites.length > 0) {
            for (var s in sites) {
              sites[s] = clean(sites[s]);
            }

            var getSiteMode = function (site) {
              if (utils.ignoreCaseEquals(site.ComputeMode, 'dedicated')) {
                return 'Standard';
              } else if (utils.ignoreCaseEquals(site.SiteMode, 'basic')) {
                return 'Shared';
              }

              return 'Free';
            };

            log.table(sites, function (row, s) {
              row.cell('Name', s.Name);
              row.cell('Status', s.State);
              row.cell('Mode', getSiteMode(s));
              row.cell('Host names', s.HostNames);
            });
          } else {
            log.info('No sites created yet. You can create new sites using "azure site create" or through the portal.');
          }
        });

  site.command('set [name]')
        .description('Sets configuration options for your web site [name]')
        .option('--net-version <net-version>', 'The .NET version. Valid options are v3.5 and v4.5')
        .option('--php-version <php-version>', 'The PHP version. Valid options are off, v5.3 and v5.4')
        .option('--platform <platform>', 'The platform. Valid options are x86 and x64')
        .option('-s, --subscription <id>', 'use the subscription id')
        .execute(function (name, options, _) {
      var context = {
        subscription: cli.category('account').lookupSubscriptionId(options.subscription),
{'fraction_non_alphanumeric': 0.1357273280584297, 'fraction_numerical': 0.005173463177115033, 'mean_word_length': 2.6885521885521886, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6775694', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1765, 'n_words': 554}