/* KMUninstall.h
 *
 * Copyright (C) 2023 OpenKylin, Inc
 */

#ifndef __KMUNINSTALLER_H__
#define __KMUNINSTALLER_H__

#include <memory>
#include <vector>

#include "app/KMSubCommand.h"
#include "common/KMOption.h"
#include "common/KMOptions.h"
#include "common/KMPackageManager.h"


using namespace std;

// 暂时只支持单一 remote
#define BASE_REOMTE "kaiming-repo"

/**
 * @brief ``kaiming uninstall`` 命令可以用来卸载开明应用。
 */
class KMUninstall : public KMSubCommand
{
    DECLARE_DYNCREATE(KMUninstall);

public:
    KMUninstall();
    ~KMUninstall();

    int despose(int argc, char **argv) override;
    int process(const vector<string> &vec_name);

    void init();

private:

    class Options;

    class Private;
    shared_ptr<Private> m_dPtr;

    vector<string> getRuntimeApp(const string &name);
};

#endif // !__KMUNINSTALLER_H__